package com.example.mntz.service.Impl;

import com.example.mntz.dao.ZhMapper;
import com.example.mntz.model.Zh;
import com.example.mntz.service.ZhService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ZhServiceImpl  implements ZhService {
    @Autowired
    ZhMapper zhMapper;

    @Override
    public void insertZh(Zh zh) {
        double initial = zhMapper.selectInitial(zh.getZqId());
        zh.setAmount(initial);
        zhMapper.insert(zh);
    }
}
